* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(200deg, #5ee7df, #b490ca);
}

.card {
    position: relative;
    width: 300px;
    height: 400px;
    border-radius: 30px;
    cursor: pointer;
    background-color: #fff;
    box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    animation: rotate-reverse 1.2s cubic-bezier(0.66, -0.47, 0.33, 1.5);
}

.card:hover {
    animation: rotate 1.2s cubic-bezier(0.66, -0.47, 0.33, 1.5);
}

.front, .back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    background-color: #fff;
    border-radius: 30px;
    backface-visibility: hidden;
}

.back {
    transform: rotateY(180deg);
}

@keyframes rotate {
    100% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

@keyframes rotate-reverse {
    0% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}